#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<unordered_map>
#include<queue>
#include<stack>

using namespace std;
class Solution {
public:
    int calculate(string s) {
        stack<int> st;
        char op = '+';
        int i = 0, n = s.size();
        while (i < n)
        {
            if (s[i] == ' ') i++;
            else if (s[i] >= '0' && s[i] <= '9')
            {
                int tmp = 0;
                while (i < n && s[i] >= '0' && s[i] <= '9') tmp = tmp * 10 + (s[i++] - '0');
                if (op == '+') st.push(tmp);
                else if (op == '-') st.push(-tmp);
                else if (op == '*') st.top() *= tmp;
                else if (op == '/') st.top() /= tmp;
            }
            else
            {
                op = s[i];
                i++;
            }
        }
        int sum = 0;
        while (!st.empty())
        {
            sum += st.top();
            st.pop();
        }
        return sum;
    }
};
int main() {
    return 0;
}